﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="UI.Module.Statistical.Index" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>酒聚汇投资者查看平台-<%=SubTitle(Request.QueryString["subtitle"])%>分析</title>
    <script src="../../js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        function load(json) {
            $('#container').highcharts({
                chart: {
                    type: 'column'
                },
                title: {
                    text: '<%=Title(Request.QueryString["title"])%>'
                },
                subtitle: {
                    text: '<%=SubTitle(Request.QueryString["subtitle"])%>'
                }, scrollbar: {
                    enabled: true //是否产生滚动条
                },
                xAxis: {
                    categories: [
                        '一月份',
                        '二月份',
                        '三月份',
                        '四月份',
                        '五月份',
                        '六月份',
                        '七月份',
                        '八月份',
                        '九月份',
                        '十月份',
                        '十一月份',
                        '十二月份'
                    ],
                    min: 0
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: '<%=yTitle(Request.QueryString["ytitle"])%>'
                    }
                },
                tooltip: {
                    headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                    pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                        '<td style="padding:0"><b>{point.y:.1f} <%=unit(Request.QueryString["unit"])%></b></td></tr>',
                    footerFormat: '</table>',
                    shared: true,
                    useHTML: true
                },
                plotOptions: {
                    column: {
                        pointPadding: 0.2,
                        borderWidth: 0
                    }
                },
                series: eval(json)
            });
        }
        $(function () {
            $.ajax({
                type: "Post",
                url: "json/getJson.aspx",
                data: "jsontype=<%=Request.QueryString["jsontype"]%> &shopid=" + $("#ddlistShop").val(),
                success: function (result) {
                    if (result == "") {
                        alert("该门店无可加载数据!");
                        return;
                    }
                    load(result);
                }
            });
            $("#ddlistShop").change(function () {
                $.ajax({
                    type: "Post",
                    url: "json/getJson.aspx",
                    data: "jsontype=<%=Request.QueryString["jsontype"]%> &shopid=" + $(this).val(),
                    success: function (result) {
                        if (result=="") {
                            alert("该门店无可加载数据!");
                            return;
                        }
                        load(result);
                    }
                });
            });

        });


    </script>
</head>
<body>
    <form id="form1" runat="server">
        <script src="../../js/highstock.js"></script>

        <h2 class="mbx">当前门店:
            <asp:DropDownList ID="ddlistShop" runat="server"></asp:DropDownList></h2>
        <div id="container" style="min-width: 500px; min-height: 760px; margin: 0 auto"></div>

    </form>
</body>
</html>
